<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
    <script type="text/javascript" src="extjs/adapter/ext/ext-base.js"></script>
    <script type="text/javascript" src="extjs/ext-all.js"></script>
    <link rel="stylesheet" type="text/css" href="extjs/resources/css/ext-all.css" />

    <script type="text/javascript" src="test.js"></script>
    <script type="text/javascript">

    function test() {
        var s = unescape(document.getElementById("fitty").value);
        var r = new RegExp(document.getElementById("reg").value, "mi");
        document.getElementById("futty").value = r.exec(s);
        
    }

    function testEdit() {
        var s = document.getElementById("fitty").value;
        var handlers = ContentAreaManager.parse(s, ContentAreaManager.match);
        
        var editors = ContentAreaManager.buildEditorBundle(handlers);

        var w = new Ext.Window({
            width : 400,
            height : 500,
            title : 'futty',
            layout : 'fit',
            items : [{
                xtype : 'form',
                items : editors
            }],
            buttons : [{
                text : 'OK',
                handler : function() {
            	    document.getElementById("futty").value = ContentAreaManager.buildContent(s, handlers);
                }
            }]
        });
        w.show(this);
    }
    </script>
</head>
<body>
<input type="text" style="width:600px" id="reg"/><input type="button" value="hit" onclick="javascript: test();"/><input type="button" value="edit" onclick="javascript: testEdit();"/>
<textarea id="fitty" style="width:100%; height:250px">
	weddwe
	<div class="contentarea" id='1'>
	wnfwfjwqejf
	   <div class='contentarea_image[imageFolder=Web Banner Images] hutty' id='1'>
	       <img src="<!-- @emp.image:begin -->Fulfilment Landing page banner<!-- @emp.image:end -->" alt="" width="750" height="150" />
	   </div><!-- contentarea_image -->
	</div><!-- contentarea -->
	<div class='contentarea' id='2'>
	1111111
	   <div class='contentarea_text' id='2'>
	       33333333
	   </div><!-- contentarea_text -->
	</div><!-- contentarea -->
</textarea>
<textarea id="futty" style="width:100%; height:250px"></textarea>
<div id="content">

    weddwe
    <div class="contentarea" id='1'>
    wnfwfjwqejf
       <div class='contentarea_image[imageFolder=Web Banner Images] hutty' id='1'>
           <img src="<!-- @emp.image:begin -->Fulfilment Landing page banner<!-- @emp.image:end -->" alt="" width="750" height="150" />
       </div><!-- contentarea_image -->
    </div><!-- contentarea -->
    <div class='contentarea' id='2'>
    1111111
       <div class='contentarea_text' id='2'>
           33333333
       </div><!-- contentarea_text -->

		<div class="contentarea_article" id="3"> 
		  <tbody>
		    <tr>
		      <td align="left" colspan="2">
		<strong> <!-- @start:article_category -->
		Category will be here
		<!-- @end:article_category --></strong>
		</td>
		    </tr>
		    <tr>
		      <td valign="top" align="left" width="73">
		<!-- @start:article_image -->
		<img height="66" width="68" src="http://mysite.com/images/cat.jpg"/>
		<!-- @end:article_image -->
		</td>
		      <td valign="top" align="left" width="303">
		<!-- @start:article_title -->Title here
		<!-- @end:article_title --><br />
		      <!-- @start:article_shortcopy -->Shortcopy here: Organized cyber attacks are  targeting …...
		<!-- @end:article_shortcopy --><br />
		      <!-- @start:article_link --><a href="$host/clickhere.html">
		<!-- @end:article_link -->
		</a>
		</td>
		    </tr>
		   </tbody>
		 </div><!-- contentarea_article -->
    </div><!-- contentarea -->

</div>
</body>
</html>